{extend name="public/base"/}
{block name="style"}

<link rel="stylesheet" href="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.css">
<script src="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.js"></script>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/webuploader/webuploader.css">
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/plugs/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/plugs/ueditor/ueditor.all.min.js"></script>
<!-- datepicker statr -->
<link href="__PUBLIC__/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/board/board.min.css">
<!-- datepicker end -->
{/block}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<form method="post" class="form form-horizontal">
			<div class="form-group">
				<label class="col-lg-2 control-label">姓名</label>
				<div class="col-lg-6 col-sm-6">
					<input type="text" class="form-control" name="username" id="username" autocomplete="false" value="">
					<div class="help-block">姓名会作为默认的昵称</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">密码</label>
				<div class="col-lg-6 col-sm-6">
					<input type="password" class="form-control" name="password" id="password" autocomplete="false" value="">
					<div class="help-block">用户密码不能少于6位</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">确认密码</label>
				<div class="col-lg-6 col-sm-6">
					<input type="password" class="form-control" name="repassword" id="repassword" autocomplete="false" value="">
					<div class="help-block">确认密码</div>
				</div>
			</div>
			<!--
			<div class="form-group">
				<label class="col-lg-2 control-label">邮箱</label>
				<div class="col-lg-10 col-sm-10">
					<input type="text" class="form-control" name="email" id="email" autocomplete="false" value="">
					<div class="help-block">邮箱，用于找回密码等安全操作</div>
				</div>
			</div>
			-->
			<div class="form-group">
				<label class="col-lg-2 control-label">部门</label>
				<div class="col-lg-6 col-sm-6">
					<select class="form-control" name="group" id="group" style="width:100%;">
						<option value="">请选择部门</option>
						{foreach name="grouplist" item="vo" key="k" }
						<option value="{$k}">{$vo}</option>
						{/foreach}
					</select>
					<div class="help-block">部门</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-lg-2 control-label">岗位</label>
				<div class="col-lg-6 col-sm-6">
					<select class="form-control" name="situation" id="situation" style="width:100%;">
						<option value="0">请选择岗位</option>
						<!-- {foreach name="situation" item="vo" key="k" }
						<option value="{$k}">{$vo}</option>
						{/foreach} -->
					</select>
					<div class="help-block"></div>
				</div>
			</div>


			<div class="form-group">
				<label class="col-lg-2 control-label">我的上级</label>
				<div class="col-lg-6 col-sm-6">
					<select class="form-control" name="pid" id="pid" style="width:100%;">
						
						{if input('pid')}
						<option value="{:input('pid')}">{$members[input('pid')]??""}</option>
						{else/}
						<option value="">请选择上级</option>
						{/if}
					</select>
					<div class="help-block">员工上级</div>
				</div>
			</div>

			

			<div class="form-group">
				<div class="col-lg-offset-2 col-lg-10">
					<input type="hidden" name="id" value="{$info['id']|default=''}">            
					<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
					<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.custom.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/droppable.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugs/board/board.min.js"></script>
<script type="text/javascript">
$(function(){
	var uid = {$Think.session.user_auth.uid};
	$('#group').on('change',function () {
		var value = $(this).val();
		console.log(value);
		if (value==3)
		{
			$('.form-horizontal').prepend('<input type="hidden" name="is_top" value="1">');
		}else{
			$('.form-horizontal').prepend('<input type="hidden" name="s_uid" value="'+uid+'">');
		

		}
	});
})
</script>
{include file="user/_select_member_group" /}
{/block}